package com.hzdesk.media.koreabatchmatvector.fragment.fragment_view;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.hzdesk.media.koreabatchmatvector.R;
import com.hzdesk.media.koreabatchmatvector.config.RxBusUtil;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_contract.BoundCloudServiceContract;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_persenter.BoundCloudServicePersenter;
import com.hzdesk.media.koreabatchmatvector.logic.view.DialogActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2018/6/22.
 * 杭州席媒科技有限公司  Developers  刘传华  15
 * 佛祖镇楼 bug辟易
 */

public class BoundCloudServiceFragment extends BaseFragment implements BoundCloudServiceContract.IBoundCloudServiceView{
    @BindView(R.id.fragment_my_boun_cloud_service_iv_back)
    ImageView fragmentMyBounCloudServiceIvBack;
    @BindView(R.id.fragment_my_boun_cloud_service_iv_qr_code)
    ImageView fragmentMyBounCloudServiceIvQrCode;
    Unbinder unbinder;
    private BoundCloudServicePersenter mBoundCloudServicePersenter = new BoundCloudServicePersenter(this);

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_my_boun_cloud_service, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mBoundCloudServicePersenter.initDate(mcontext,fragmentMyBounCloudServiceIvQrCode);
    }

    @OnClick({R.id.fragment_my_boun_cloud_service_iv_back, R.id.fragment_my_boun_cloud_service_iv_qr_code})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.fragment_my_boun_cloud_service_iv_back:
                mBoundCloudServicePersenter.onClickeBack();
                break;
            case R.id.fragment_my_boun_cloud_service_iv_qr_code:
                break;
        }
    }
    @Override
    public void toDialogPager() {
        Intent intent =   new Intent(mcontext, DialogActivity.class);
        intent.putExtra("Dialog_viewpage_index", RxBusUtil.CHANGE_SET_FRAGMENT);
        startActivity(intent);
    }
    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
